<?php if(!IS_AJAX){?>

<include file="Public:header" />
<div class="row">
  <div class="col-sm-12"><br>
    <section class="panel">
      <header class="panel-heading custom-tab dark-tab">
        <ul class="nav nav-tabs">
          <li class="active"> <a href="#home2" data-toggle="tab">修改登录密码</a> </li>
          <li class=""> <a href="#about2" data-toggle="tab">修改提现密码</a> </li>
          <li class=""> <a href="#about3" data-toggle="tab">绑定手机号</a> </li>
        </ul>
      </header>
      <div class="panel-body">
        <div class="tab-content">
          <div class="tab-pane active" id="home2"> <br>
            <br>
            <br>
            <form class="form-horizontal" id="pwdc" action="{:U('pwdchange')}" method="post" role="form">
              <div class="form-group">
                <label for="inputPassword1" class="col-lg-3 col-sm-3 control-label">原密码</label>
                <div class="col-lg-6">
                  <input type="password" class="form-control" name="oldpassword" id="oldpassword" placeholder="请输入原密码">
                </div>
              </div>
              <div class="form-group">
                <label for="inputPassword1" class="col-lg-3 col-sm-3 control-label">新密码</label>
                <div class="col-lg-6">
                  <input type="password" class="form-control" name="newpassword" id="newpassword1" placeholder="新密码">
                  <div class="pass-wrap"> <em>密码强度：</em>
                    <div id="passStrength1"></div>
                  </div>
                </div>
              </div>
              <div class="form-group">
                <label for="inputPassword1" class="col-lg-3 col-sm-3 control-label">确认密码</label>
                <div class="col-lg-6">
                  <input type="password" class="form-control" name="renewpassword" id="renewpassword" placeholder="确认密码">
                </div>
              </div>
              <div class="form-group">
                <div class="col-lg-offset-3 col-lg-6">
                  <button type="submit" class="btn btn-primary">确认修改</button>
                </div>
              </div>
            </form>
            <br>
            <br>
            <br>
          </div>
          <div class="tab-pane" id="about2"><br>
            <br>
            <br>
            <eq name="info['VerifyPhone']" value="1">
            <form class="form-horizontal" id="verifymobile2" action="{:U('setpwdverifymobile')}" method="post" role="form">
              <div class="form-group">
                <label for="inputPassword1" class="col-lg-3 col-sm-3 control-label"></label>
                <div class="col-lg-6">
                  <p><i style="font-size:24px;" class="fa fa-mobile"></i>&nbsp;&nbsp;<span style="color:#ccc; font-size:18px;">{:hidtel($info['tel'])}</span></p>
                  
                  
                  
                 
                </div>
              </div><div class="form-group">
                <label for="inputPassword1" class="col-lg-3 col-sm-3 control-label">验证码</label>
<div class="col-lg-6">
                  <input style="display:inline; width:auto;" type="text" class="form-control" name="verifytelpwd" id="verifytelpwd" placeholder="验证码">
                  <button style="vertical-align:top;" type="button" id="sendsms2" class="btn btn-primary">获取验证码</button>
                </div>
              </div>
             <div class="form-group">
                <label for="inputPassword1" class="col-lg-3 col-sm-3 control-label">设置密码</label>
                <div class="col-lg-6">
                  <input type="password" class="form-control" name="pwd" id="newpassword2" placeholder="密码">
                  <div class="pass-wrap"> <em>密码强度：</em>
                    <div id="passStrength2"></div>
                  </div>
                </div>
              </div>
              <div class="form-group">
                <label for="inputPassword1" class="col-lg-3 col-sm-3 control-label">确认密码</label>
                <div class="col-lg-6">
                  <input type="password" class="form-control" name="repwd" id="repwd" placeholder="确认密码">
                </div>
              </div>
              <div class="form-group">
                <div class="col-lg-offset-3 col-lg-6">
                  <button type="submit" class="btn btn-primary">确认修改</button>
                </div>
              </div>
              <else/>
              <div class="form-group">
                <div class="col-lg-offset-3 col-lg-6"> 请先绑定手机号，再设置提现密码。 </div>
              </div>
            </eq>
            
              
            </form>
            <br>
            <br>
            <br>
          </div>
          <div class="tab-pane" id="about3">
            <eq name="info['VerifyPhone']" value="0"><br>
              <br>
              <br>
              <form class="form-horizontal" id="mobilebind" action="{:U('mobilebind')}" method="post" role="form">
                <div class="form-group">
                  <label for="inputPassword1" class="col-lg-3 col-sm-3 control-label">手机号码</label>
                  <div class="col-lg-6">
                    <input style="display:inline; width:auto;" type="text" class="form-control" name="verifytel" id="verifytel" placeholder="填写手机号码">
                    <button style="vertical-align:top;" type="button" id="sendsms1" class="btn btn-primary">获取验证码</button>
                  </div>
                </div>
                <div class="form-group">
                  <label for="inputPassword1" class="col-lg-3 col-sm-3 control-label">验证码</label>
                  <div class="col-lg-6">
                    <input type="text" class="form-control" name="verify" placeholder="验证码">
                  </div>
                </div>
                <div class="form-group">
                  <div class="col-lg-offset-3 col-lg-6">
                    <button type="submit" class="btn btn-primary">绑定</button>
                  </div>
                </div>
              </form>
              <br>
              <br>
              <br>
              <else/>
              <br>
              <br>
              <br>
              <div class="form-group">
                <div class="col-lg-offset-3 col-lg-6">
                  <p>已经绑定</p>
                  <p><i style="font-size:24px;" class="fa fa-mobile"></i>&nbsp;&nbsp;<span style="color:#ccc; font-size:18px;">{:hidtel($info['tel'])}</span>&nbsp;&nbsp;&nbsp;<a href="##" data-toggle="modal" data-target="#myModal">解绑</a></p>
                  <p>您已经绑定了手机号码，如果您想重新绑定，请点击解绑。</p>
                </div>
              </div>
              <br>
              <br>
              <br>
              <br>
              <br>
            </eq>
          </div>
        </div>
      </div>
    </section>
  </div>
</div>

<!-- 模态框（Modal） -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title" id="myModalLabel">手机号解绑</h4>
      </div>
      <div class="modal-body">
        <form action="{:U('mobileunbind')}" id="mobileunbind" method="post" role="form">
          <div style="padding:30px 50px;">
            <div  class="form-inline">
              <div class="form-group">
                <label class="sr-only" for="exampleInputPassword2">验证码</label>
                <input type="text" name="verify" class="form-control" id="exampleInputPassword2" placeholder="验证码">
              </div>
              <button type="button" id="sendsms" class="btn btn-primary">获取验证码</button>
            </div>
          </div>
        </form>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
        <button type="button" onClick="$('#mobileunbind').submit();" class="btn btn-primary">解绑</button>
      </div>
    </div>
    <!-- /.modal-content --> 
  </div>
  <!-- /.modal --> 
</div>
<include file="Public:footer" /> 
<script>




var countdown = 5*60; 
function settime(val) {
if (countdown == 0) {
val.removeAttribute("disabled");    
val.innerHTML="获取验证码"; 
countdown = 5*60; 
} else { 
val.setAttribute("disabled", true); 
val.innerHTML="重新发送(" + countdown + ")"; 
countdown--; 
} 
setTimeout(function() { 
settime(val) 
},1000) 
} 

$('#sendsms').click(function(e) {
	
    $.post('{:U('sendmsm')}', { 
	}, function(d){
		alert(d.info);
		if(d.status == 1){
			settime(document.getElementById('sendsms'));
		}
		
	},'json');
});


$('#sendsms1').click(function(e) {
	
    $.post('{:U('sendmsm')}', {
		tel: $('#verifytel').val()
	}, function(d){
		alert(d.info);
		if(d.status == 1){
			settime(document.getElementById('sendsms1'));
		}
		
	},'json');
});


$('#sendsms2').click(function(e) {
	
    $.post('{:U('sendmsm')}', {
	}, function(d){
		alert(d.info);
		if(d.status == 1){
			settime(document.getElementById('sendsms2'));
		}
		
	},'json');
});


function PasswordStrength(passwordID,strengthID){ 
this.init(strengthID); 
var _this = this; 
document.getElementById(passwordID).onkeyup = function(){ 
_this.checkStrength(this.value); 
} 
}; 
PasswordStrength.prototype.init = function(strengthID){ 
var id = document.getElementById(strengthID); 
var div = document.createElement('div'); 
var strong = document.createElement('strong'); 
this.oStrength = id.appendChild(div); 
this.oStrengthTxt = id.parentNode.appendChild(strong); 
}; 
PasswordStrength.prototype.checkStrength = function (val){ 
var aLvTxt = ['','低','中','高']; 
var lv = 0; 
if(val.match(/[a-z]/g)){lv++;} 
if(val.match(/[0-9]/g)){lv++;} 
if(val.match(/(.[^a-z0-9])/g)){lv++;} 
if(val.length < 6){lv=0;} 
if(lv > 3){lv=3;} 
this.oStrength.className = 'strengthLv' + lv; 
this.oStrengthTxt.innerHTML = aLvTxt[lv]; 
}; 


new PasswordStrength('newpassword1','passStrength1'); 
new PasswordStrength('newpassword2','passStrength2'); 
</script>
<style type="text/css"> 
#passStrength1{width:120px;border:1px solid #eee;}
#passStrength2{width:120px;border:1px solid #eee;}
.strengthLv1{background:red;height:6px;width:40px;} 
.strengthLv2{background:orange;height:6px;width:80px;} 
.strengthLv3{background:green;height:6px;width:120px;} 

    .option a.btn{margin-top:5px;}
</style>
<script src="/Public/setajax.js"></script> 
<script>
    $('#pwdc').ajaxsubmit({
		success:function(ret){
			if(ret.status == 1){
				window.location.href = ret.url;
			}
		}
	});
	$('#verifymobile2').ajaxsubmit({
		success:function(ret){
		}
	});
	$('#mobileunbind').ajaxsubmit({
		success:function(ret){
			window.location.reload();
		}
	});
	$('#mobilebind').ajaxsubmit({
		success:function(ret){
			window.location.reload();
		}
	});
</script>
</body></html><?php }?>